﻿Public Class FrmMain

    Private Function kiemtratontai(ByVal Frmname As String) As [Boolean]
        For Each Frm As Form In Me.MdiChildren
            If Frm.Name.Equals(Frmname) Then
                Frm.Activate()
                Return True
            End If
        Next
        Return False
    End Function
    Private Sub RibbonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RibbonButton1.Click
        If kiemtratontai("FrmThuNgan") = False Then
            Dim f As New FrmThuNgan()
            f.MdiParent = Me
            f.Name = "FrmThuNgan"
            f.WindowState = FormWindowState.Maximized
            f.Show()
        End If
    End Sub

    
End Class